package cn.pku.edu.cs.ldn;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.app.Activity;
import android.content.Intent;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		findViewById(R.id.mapView).setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				go(v);
			}
		});
	}

	private void go(View v) {
		Intent intent = new Intent(this, TestActivity.class);
		Bundle bundle = new Bundle();
		int[] position = new int[4];
		position[0] = v.getLeft();
		position[1] = v.getTop();
		position[2] = v.getRight();
		position[3] = v.getBottom();
		bundle.putIntArray("position", position);
		intent.putExtras(bundle);
		startActivity(intent);
	}

}
